#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : micah
# @time    :  
# @function: 
# @version :


import time
import asyncio

now = lambda: time.time()


async def func():
    # 不要在创建task的时候进行await,否则会变成同步执行
    await asyncio.create_task(asyncio.sleep(1))
    await asyncio.create_task(asyncio.sleep(1))


start = now()

for i in range(5):
    asyncio.run(func())


print('异步所花费的时间：%f s' % (now() - start))
